<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red{
            color: red;
        }
        .blue{
            color: blue;
        }
        .A{
            font-size: 50px;
            background-color: springgreen;
        }
    </style>
</head>
<body>
    <p class="red A blue">是一个p标签</p>
    <button id="btn">点我切换</button>
    <script>
        var p = document.querySelector("p")
        // /* 添加 */
        // p.classList.add("blue")
        // /* 删除 */
        // p.classList.remove("blue")
        // /* 切换 */
        // btn.onclick = function(){
        //     p.classList.toggle("blue")
        // }
        console.log(p.classList);


        /* className */
        //设置
        // p.className = "blue"

        // console.log(p.className);

        // p.className += " A"

    </script>
</body>
</html>